package config

import (
	"github.com/zeromicro/go-zero/core/stores/redis"
	"github.com/zeromicro/go-zero/rest"
)

type Config struct {
	rest.RestConf
	Redis redis.RedisConf `json:",optional"`
	Auth  struct {
		AccessSecret string
		AccessExpire int64
	}
	Db DbConf `json:",optional"`
}

type DbConf struct {
	Host                     string
	Port                     int
	Username                 string
	Password                 string
	Db                       string
	ParamStr                 string `json:",optional"`
	MaxOpenConns             int    `json:",default=10"`
	MaxIdleConns             int    `json:",default=5"`
	ConnMaxIdleTime          int    `json:",default=60"`
	ConnMaxLifetime          int    `json:",default=60"`
	SlowThresholdMillisecond int64  `json:",default=1000"`
}
